import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooSensitiveWordController } from '../../../controllers';
const uctoosensitiveWordRouter = new Router();
const sensitiveWordController = new uctooSensitiveWordController();

uctoosensitiveWordRouter.post('/add', requireUser, sensitiveWordController.add);
uctoosensitiveWordRouter.post('/edit', requireUser, rowLevelPermission('uctoo/sensitive_word'), sensitiveWordController.edit);
uctoosensitiveWordRouter.post('/del', requireUser, rowLevelPermission('uctoo/sensitive_word'), sensitiveWordController.delete);

//For getting sensitiveWord with permission control
uctoosensitiveWordRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/sensitive_word'), sensitiveWordController.getSingle);
uctoosensitiveWordRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/sensitive_word'), sensitiveWordController.getMany);
uctoosensitiveWordRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/sensitive_word'), sensitiveWordController.getMany);

//#endregion AutoCreateCode
export default uctoosensitiveWordRouter;
